package com.caifu.neums;


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * ClassName :StayBackReasonEnum
 *
 * @author :  yb
 * @description ：
 * @date : 2020-11-17 15:24
 */
public enum StayBackReasonEnum {


    /**
     *  退住理由 1:死亡 2 合同到期 3 入住医院 4：退出敬老院
     */
    SW("1", "死亡")
    ,HTDQ("2", "合同到期")
    ,RZYY("3", "入住医院")
    ,TCYLY("4", "退出敬老院")
    ;

    private String key;
    private String value;
    StayBackReasonEnum(String key, String value) {
        this.key = key;
        this.value = value;
    }


    public static List<Map<String,Object>> getStayBackReasonList(){
        List<Map<String, Object>> list = new ArrayList<>();
        for (StayBackReasonEnum c : StayBackReasonEnum.values()) {
            Map<String, Object> map = new HashMap<>();
            map.put("value", c.getKey());
            map.put("name", c.getValue());
            list.add(map);
        }
        return list;
    }


    public static String getName(String key) {
        for (StayBackReasonEnum c : StayBackReasonEnum.values()) {
            if (c.getKey().equals(key)) {
                return c.value;
            }
        }
        return "";
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }
}
